﻿using Inovout.Models;

namespace Inovout.Cloud.Data.Blob.Models
{
    partial class File : DataObject
    {
        public virtual string Name { get; set; }
        private string key;
        public virtual string Key { get { return key; } }
        public virtual Directory Directory { get; set; }
        private string path;
        public virtual string Path
        {
            get { return path; }
            set
            {
                path = value;
                if (string.IsNullOrEmpty(key) && Id == null)
                {
                    key = CryptographyHelper.GetMD5HashValue(path);
                }

            }
        }
        public virtual long Length { get; set; }
        public virtual bool IsUploaded { get; set; }
        public virtual string Owner { get; set; }
    }
}
